<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Storage;

class UploadController extends Controller
{
    public function store(Request $request)
    {
    	if($request->file('file')->isValid())
    	{
    		$path = $request->file('file')->store('uploads');
    		return response()->json([
    			'code' => 0,
    			'message' => '',
    			'data' => [
    				'src' => $path,
    				'full_path' => Storage::url($path),
    			],
    		]);
    	}
    }
}
